package com.zgc.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test/service1")
public class TestService1Controller {


    @Autowired
    private ConfigurableApplicationContext cac;

    @GetMapping("/getExtConfigs")
    public String getExtConfigs() {

        String name = cac.getEnvironment().getProperty("common.name");
        System.out.println("name = " + name);
        return name;
    }

    @GetMapping("/sayHello")
    public String sayHello(){
        String str = "hello";
        System.out.println("str = " + str);
        return str;
    }


}
